﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Biz_Dal.Biz;

public partial class Trang_web_Trang_Don_Dat_Hang_Cu : System.Web.UI.Page
{
    List<BizDonDatHang> listDDH;
    List<BizCTDonDatHang> listctddh;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            if (Session["Dang_nhap"] != null)
            {
                GridViewDDH.Visible = true;
                listDDH = BizDonDatHang.getDDHByIDKhachHang(int.Parse(Session["Ma_KH"].ToString()));
                GridViewDDH.DataSource = listDDH;
                GridViewDDH.DataBind();
            }
    }
    protected void GridViewDDH_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridViewRow row = GridViewDDH.SelectedRow;
        int id = Convert.ToInt32(row.Cells[0].Text.ToString());
        listctddh=BizCTDonDatHang.GetChiTietDonDatHangByIDDDH(id);
        GridViewCTDDH.DataSource = listctddh;
        GridViewCTDDH.DataBind();
    }
}